package com.ssyt.store.sys.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ssyt.store.sys.dao.StoreReceiveAddressDao;
import com.ssyt.store.sys.entity.StoreReceiveAddress;
import com.ssyt.store.sys.service.StoreReceiveAddressService;

@Service
public class StoreReceiveAddressServiceImpl implements StoreReceiveAddressService {

	@Autowired
	private StoreReceiveAddressDao storeReceiveAddressDao;
	
	@Override
	public List<StoreReceiveAddress> getAddressByUserId(String userId) {
		return storeReceiveAddressDao.getAddressByUserId(userId);
	}

	@Override
	public void addStoreReceiveAddress(StoreReceiveAddress address) {
		storeReceiveAddressDao.addStoreReceiveAddress(address);
	}

	@Override
	public void deleteStoreReceiveAddress(String id) {
		storeReceiveAddressDao.deleteStoreReceiveAddress(id);
	}

	@Override
	public StoreReceiveAddress getAddressById(String Id) {
		return storeReceiveAddressDao.getAddressById(Id);
	}

	@Override
	public StoreReceiveAddress getUserDefualtAddress(String userId) {
		return storeReceiveAddressDao.getUserDefualtAddress(userId);
	}

	@Override
	public void saveOrUpdateAddress(StoreReceiveAddress storeReceiveAddress) {
		storeReceiveAddressDao.saveOrUpdateAddress(storeReceiveAddress);
	}

	@Override
	public void useAddressToDefault(String Id, String userId) {
		storeReceiveAddressDao.useAddressToDefault(Id, userId);
	}

}
